package com.matrix.async.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.UUIDUtil;
import com.matrix.async.bean.AsyncConfigurationBean;
import com.matrix.async.dao.AsyncConfigurationDao;
import com.matrix.async.service.AsyncConfigurationService;
@Service
public class AsyncConfigurationServiceImpl implements AsyncConfigurationService{

	@Autowired
	AsyncConfigurationDao asyncConfigurationDao;

	@Override
	public int add(AsyncConfigurationBean configuration) {
		configuration.setId(UUIDUtil.getRandomID());
		return asyncConfigurationDao.insert(configuration);
	}

	@Override
	public int remove(List<String> list) {
		return asyncConfigurationDao.deleteByIds(list);
	}

	@Override
	public List<AsyncConfigurationBean> findInPage(AsyncConfigurationBean configuration, PaginationVO pageVo) {
		return asyncConfigurationDao.selectInPage(configuration, pageVo);
	}

	@Override
	public int findTotal(AsyncConfigurationBean configuration) {
		return asyncConfigurationDao.selectTotalRecord(configuration);
	}

	@Override
	public AsyncConfigurationBean findById(String id) {
		return asyncConfigurationDao.selectById(id);
	}

	@Override
	public List<AsyncConfigurationBean> findByModel(AsyncConfigurationBean configuration) {
		return null;
	}

	@Override
	public int removeById(String id) {
		return 0;
	}

	@Override
	public int modifyByMap(AsyncConfigurationBean oldValue,AsyncConfigurationBean newValue) {
		return 0;
	}
	
	@Override
	public int modifyByMap(Map<String, Object> modifyMap) {
		return asyncConfigurationDao.updateByMap(modifyMap);
	}

	@Override
	public int selectCountByTaskType(String taskType) {
		return asyncConfigurationDao.selectCountByTaskType(taskType);
	}

}
